struct Mesh {
  /* @offset(0) */
  world : mat4x4<f32>,
  /* @offset(64) */
  visibility : f32,
}

struct LeftOver {
  /* @offset(0) */
  boneTextureWidth : f32,
  /* @offset(16) */
  biasAndScaleSM : vec3<f32>,
  /* @offset(32) */
  depthValuesSM : vec2<f32>,
}

struct Scene {
  /* @offset(0) */
  viewProjection : mat4x4<f32>,
  /* @offset(64) */
  view : mat4x4<f32>,
  /* @offset(128) */
  projection : mat4x4<f32>,
  /* @offset(192) */
  vEyePosition : vec4<f32>,
}

struct Internals {
  /* @offset(0) */
  yFactor_ : f32,
  /* @offset(4) */
  textureOutputHeight_ : f32,
}

var<private> position_1 : vec3<f32>;

@group(1) @binding(3) var<uniform> x_19 : Mesh;

var<private> matricesIndices : vec4<f32>;

@group(1) @binding(4) var<uniform> x_41 : LeftOver;

@group(1) @binding(1) var boneSamplerTexture : texture_2d<f32>;

@group(1) @binding(2) var boneSamplerSampler : sampler;

var<private> matricesWeights : vec4<f32>;

@group(0) @binding(0) var<uniform> x_427 : Scene;

var<private> vDepthMetricSM : f32;

@group(1) @binding(0) var<uniform> x_451 : Internals;

var<private> gl_Position : vec4<f32>;

fn main_1() {
  var positionUpdated : vec3<f32>;
  var finalWorld : mat4x4<f32>;
  var offset_1 : f32;
  var dx : f32;
  var m0 : vec4<f32>;
  var m1 : vec4<f32>;
  var m2 : vec4<f32>;
  var m3 : vec4<f32>;
  var readMatrixFromRawSampler_0 : mat4x4<f32>;
  var influence : mat4x4<f32>;
  var offset_2 : f32;
  var dx_1 : f32;
  var m0_1 : vec4<f32>;
  var m1_1 : vec4<f32>;
  var m2_1 : vec4<f32>;
  var m3_1 : vec4<f32>;
  var readMatrixFromRawSampler_1 : mat4x4<f32>;
  var offset_3 : f32;
  var dx_2 : f32;
  var m0_2 : vec4<f32>;
  var m1_2 : vec4<f32>;
  var m2_2 : vec4<f32>;
  var m3_2 : vec4<f32>;
  var readMatrixFromRawSampler_2 : mat4x4<f32>;
  var offset_4 : f32;
  var dx_3 : f32;
  var m0_3 : vec4<f32>;
  var m1_3 : vec4<f32>;
  var m2_3 : vec4<f32>;
  var m3_3 : vec4<f32>;
  var readMatrixFromRawSampler_3 : mat4x4<f32>;
  var worldPos : vec4<f32>;
  let x_12 : vec3<f32> = position_1;
  positionUpdated = x_12;
  let x_24 : mat4x4<f32> = x_19.world;
  finalWorld = x_24;
  let x_33 : f32 = matricesIndices.x;
  offset_1 = (x_33 * 4.0f);
  let x_44 : f32 = x_41.boneTextureWidth;
  dx = (1.0f / x_44);
  let x_58 : f32 = dx;
  let x_59 : f32 = offset_1;
  let x_65 : vec4<f32> = textureSampleLevel(boneSamplerTexture, boneSamplerSampler, vec2<f32>((x_58 * (x_59 + 0.5f)), 0.0f), 0.0f);
  m0 = x_65;
  let x_70 : f32 = dx;
  let x_71 : f32 = offset_1;
  let x_76 : vec4<f32> = textureSampleLevel(boneSamplerTexture, boneSamplerSampler, vec2<f32>((x_70 * (x_71 + 1.5f)), 0.0f), 0.0f);
  m1 = x_76;
  let x_81 : f32 = dx;
  let x_82 : f32 = offset_1;
  let x_87 : vec4<f32> = textureSampleLevel(boneSamplerTexture, boneSamplerSampler, vec2<f32>((x_81 * (x_82 + 2.5f)), 0.0f), 0.0f);
  m2 = x_87;
  let x_92 : f32 = dx;
  let x_93 : f32 = offset_1;
  let x_98 : vec4<f32> = textureSampleLevel(boneSamplerTexture, boneSamplerSampler, vec2<f32>((x_92 * (x_93 + 3.5f)), 0.0f), 0.0f);
  m3 = x_98;
  let x_100 : vec4<f32> = m0;
  let x_101 : vec4<f32> = m1;
  let x_102 : vec4<f32> = m2;
  let x_103 : vec4<f32> = m3;
  readMatrixFromRawSampler_0 = mat4x4<f32>(vec4<f32>(x_100.x, x_100.y, x_100.z, x_100.w), vec4<f32>(x_101.x, x_101.y, x_101.z, x_101.w), vec4<f32>(x_102.x, x_102.y, x_102.z, x_102.w), vec4<f32>(x_103.x, x_103.y, x_103.z, x_103.w));
  let x_126 : mat4x4<f32> = readMatrixFromRawSampler_0;
  let x_129 : f32 = matricesWeights.x;
  influence = (x_126 * x_129);
  let x_134 : f32 = matricesIndices.y;
  offset_2 = (x_134 * 4.0f);
  let x_138 : f32 = x_41.boneTextureWidth;
  dx_1 = (1.0f / x_138);
  let x_144 : f32 = dx_1;
  let x_145 : f32 = offset_2;
  let x_149 : vec4<f32> = textureSampleLevel(boneSamplerTexture, boneSamplerSampler, vec2<f32>((x_144 * (x_145 + 0.5f)), 0.0f), 0.0f);
  m0_1 = x_149;
  let x_154 : f32 = dx_1;
  let x_155 : f32 = offset_2;
  let x_159 : vec4<f32> = textureSampleLevel(boneSamplerTexture, boneSamplerSampler, vec2<f32>((x_154 * (x_155 + 1.5f)), 0.0f), 0.0f);
  m1_1 = x_159;
  let x_164 : f32 = dx_1;
  let x_165 : f32 = offset_2;
  let x_169 : vec4<f32> = textureSampleLevel(boneSamplerTexture, boneSamplerSampler, vec2<f32>((x_164 * (x_165 + 2.5f)), 0.0f), 0.0f);
  m2_1 = x_169;
  let x_174 : f32 = dx_1;
  let x_175 : f32 = offset_2;
  let x_179 : vec4<f32> = textureSampleLevel(boneSamplerTexture, boneSamplerSampler, vec2<f32>((x_174 * (x_175 + 3.5f)), 0.0f), 0.0f);
  m3_1 = x_179;
  let x_181 : vec4<f32> = m0_1;
  let x_182 : vec4<f32> = m1_1;
  let x_183 : vec4<f32> = m2_1;
  let x_184 : vec4<f32> = m3_1;
  readMatrixFromRawSampler_1 = mat4x4<f32>(vec4<f32>(x_181.x, x_181.y, x_181.z, x_181.w), vec4<f32>(x_182.x, x_182.y, x_182.z, x_182.w), vec4<f32>(x_183.x, x_183.y, x_183.z, x_183.w), vec4<f32>(x_184.x, x_184.y, x_184.z, x_184.w));
  let x_206 : mat4x4<f32> = readMatrixFromRawSampler_1;
  let x_208 : f32 = matricesWeights.y;
  let x_209 : mat4x4<f32> = (x_206 * x_208);
  let x_210 : mat4x4<f32> = influence;
  influence = mat4x4<f32>((x_210[0u] + x_209[0u]), (x_210[1u] + x_209[1u]), (x_210[2u] + x_209[2u]), (x_210[3u] + x_209[3u]));
  let x_227 : f32 = matricesIndices.z;
  offset_3 = (x_227 * 4.0f);
  let x_231 : f32 = x_41.boneTextureWidth;
  dx_2 = (1.0f / x_231);
  let x_237 : f32 = dx_2;
  let x_238 : f32 = offset_3;
  let x_242 : vec4<f32> = textureSampleLevel(boneSamplerTexture, boneSamplerSampler, vec2<f32>((x_237 * (x_238 + 0.5f)), 0.0f), 0.0f);
  m0_2 = x_242;
  let x_247 : f32 = dx_2;
  let x_248 : f32 = offset_3;
  let x_252 : vec4<f32> = textureSampleLevel(boneSamplerTexture, boneSamplerSampler, vec2<f32>((x_247 * (x_248 + 1.5f)), 0.0f), 0.0f);
  m1_2 = x_252;
  let x_257 : f32 = dx_2;
  let x_258 : f32 = offset_3;
  let x_262 : vec4<f32> = textureSampleLevel(boneSamplerTexture, boneSamplerSampler, vec2<f32>((x_257 * (x_258 + 2.5f)), 0.0f), 0.0f);
  m2_2 = x_262;
  let x_267 : f32 = dx_2;
  let x_268 : f32 = offset_3;
  let x_272 : vec4<f32> = textureSampleLevel(boneSamplerTexture, boneSamplerSampler, vec2<f32>((x_267 * (x_268 + 3.5f)), 0.0f), 0.0f);
  m3_2 = x_272;
  let x_274 : vec4<f32> = m0_2;
  let x_275 : vec4<f32> = m1_2;
  let x_276 : vec4<f32> = m2_2;
  let x_277 : vec4<f32> = m3_2;
  readMatrixFromRawSampler_2 = mat4x4<f32>(vec4<f32>(x_274.x, x_274.y, x_274.z, x_274.w), vec4<f32>(x_275.x, x_275.y, x_275.z, x_275.w), vec4<f32>(x_276.x, x_276.y, x_276.z, x_276.w), vec4<f32>(x_277.x, x_277.y, x_277.z, x_277.w));
  let x_299 : mat4x4<f32> = readMatrixFromRawSampler_2;
  let x_301 : f32 = matricesWeights.z;
  let x_302 : mat4x4<f32> = (x_299 * x_301);
  let x_303 : mat4x4<f32> = influence;
  influence = mat4x4<f32>((x_303[0u] + x_302[0u]), (x_303[1u] + x_302[1u]), (x_303[2u] + x_302[2u]), (x_303[3u] + x_302[3u]));
  let x_320 : f32 = matricesIndices.w;
  offset_4 = (x_320 * 4.0f);
  let x_324 : f32 = x_41.boneTextureWidth;
  dx_3 = (1.0f / x_324);
  let x_330 : f32 = dx_3;
  let x_331 : f32 = offset_4;
  let x_335 : vec4<f32> = textureSampleLevel(boneSamplerTexture, boneSamplerSampler, vec2<f32>((x_330 * (x_331 + 0.5f)), 0.0f), 0.0f);
  m0_3 = x_335;
  let x_340 : f32 = dx_3;
  let x_341 : f32 = offset_4;
  let x_345 : vec4<f32> = textureSampleLevel(boneSamplerTexture, boneSamplerSampler, vec2<f32>((x_340 * (x_341 + 1.5f)), 0.0f), 0.0f);
  m1_3 = x_345;
  let x_350 : f32 = dx_3;
  let x_351 : f32 = offset_4;
  let x_355 : vec4<f32> = textureSampleLevel(boneSamplerTexture, boneSamplerSampler, vec2<f32>((x_350 * (x_351 + 2.5f)), 0.0f), 0.0f);
  m2_3 = x_355;
  let x_360 : f32 = dx_3;
  let x_361 : f32 = offset_4;
  let x_365 : vec4<f32> = textureSampleLevel(boneSamplerTexture, boneSamplerSampler, vec2<f32>((x_360 * (x_361 + 3.5f)), 0.0f), 0.0f);
  m3_3 = x_365;
  let x_367 : vec4<f32> = m0_3;
  let x_368 : vec4<f32> = m1_3;
  let x_369 : vec4<f32> = m2_3;
  let x_370 : vec4<f32> = m3_3;
  readMatrixFromRawSampler_3 = mat4x4<f32>(vec4<f32>(x_367.x, x_367.y, x_367.z, x_367.w), vec4<f32>(x_368.x, x_368.y, x_368.z, x_368.w), vec4<f32>(x_369.x, x_369.y, x_369.z, x_369.w), vec4<f32>(x_370.x, x_370.y, x_370.z, x_370.w));
  let x_392 : mat4x4<f32> = readMatrixFromRawSampler_3;
  let x_394 : f32 = matricesWeights.w;
  let x_395 : mat4x4<f32> = (x_392 * x_394);
  let x_396 : mat4x4<f32> = influence;
  influence = mat4x4<f32>((x_396[0u] + x_395[0u]), (x_396[1u] + x_395[1u]), (x_396[2u] + x_395[2u]), (x_396[3u] + x_395[3u]));
  let x_410 : mat4x4<f32> = finalWorld;
  let x_411 : mat4x4<f32> = influence;
  finalWorld = (x_410 * x_411);
  let x_414 : mat4x4<f32> = finalWorld;
  let x_415 : vec3<f32> = positionUpdated;
  worldPos = (x_414 * vec4<f32>(x_415.x, x_415.y, x_415.z, 1.0f));
  let x_429 : mat4x4<f32> = x_427.viewProjection;
  let x_430 : vec4<f32> = worldPos;
  gl_Position = (x_429 * x_430);
  let x_437 : f32 = gl_Position.z;
  let x_440 : f32 = x_41.depthValuesSM.x;
  let x_443 : f32 = x_41.depthValuesSM.y;
  let x_447 : f32 = x_41.biasAndScaleSM.x;
  vDepthMetricSM = (((x_437 + x_440) / x_443) + x_447);
  let x_453 : f32 = x_451.yFactor_;
  let x_455 : f32 = gl_Position.y;
  gl_Position.y = (x_455 * x_453);
  return;
}

struct main_out {
  @builtin(position)
  gl_Position : vec4<f32>,
  @location(0)
  vDepthMetricSM_1 : f32,
}

@vertex
fn main(@location(0) position_1_param : vec3<f32>, @location(1) matricesIndices_param : vec4<f32>, @location(2) matricesWeights_param : vec4<f32>) -> main_out {
  position_1 = position_1_param;
  matricesIndices = matricesIndices_param;
  matricesWeights = matricesWeights_param;
  main_1();
  return main_out(gl_Position, vDepthMetricSM);
}